﻿using System;
using System.Collections.Generic;
using System.Drawing;

namespace XCI.Core
{
    /// <summary>
    /// 上传文件
    /// </summary>
    public class UploadFile
    {
        /// <summary>
        /// 文件名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 扩展名
        /// </summary>
        public string ExtName { get; set; }

        /// <summary>
        /// 文件路径
        /// </summary>
        public string Path { get; set; }

        /// <summary>
        /// 是否是图片文件
        /// </summary>
        public bool IsImageFile { get; set; }

        /// <summary>
        /// 文件图片
        /// </summary>
        public Image Image { get; set; }

        /// <summary>
        /// 文件大小
        /// </summary>
        public long Size { get; set; }

        /// <summary>
        /// 文件大小文本
        /// </summary>
        public string SizeText { get { return XCI.Helper.StringHelper.GetSpaceSizeString(Size); } }

        /// <summary>
        /// 上传消息
        /// </summary>
        public string Msg { get; set; }

        /// <summary>
        /// 上传进度
        /// </summary>
        public int Percentage { get; set; }

        /// <summary>
        /// 服务端对象
        /// </summary>
        public FileModel ServerFileModel { get; set; }
    }

    /// <summary>
    /// 上传图片文件
    /// </summary>
    public class GalleryImageFile
    {
        /// <summary>
        /// 文件唯一标识
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 文件名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 文件路径
        /// </summary>
        public string Path { get; set; }

        /// <summary>
        /// 文件上传状态
        /// </summary>
        public bool IsUpload { get; set; }
    }

    public class FileBeforeEventArgs : EventArgs
    {
        /// <summary>
        /// 是否取消
        /// </summary>
        public bool Cancel { get; set; }
    }

    public class ImageBeforeEventArgs : FileBeforeEventArgs
    {
    }
    public class FileEventArgs : EventArgs
    {
    }
    public class ImageEventArgs : FileEventArgs
    {
    }

    public class FileUploadEventArgs : EventArgs
    {
        public List<UploadFile> SuccessList { get; set; }
        public List<UploadFile> FailList { get; set; }
    }
    public class ImageUploadEventArgs : EventArgs
    {
        public FileModel FileModelInfo { get; set; }
    }

    public class GalleryImageUploadEventArgs : EventArgs
    {
        public List<GalleryImageFile> FileList { get; set; }
    }
}
